import time

from django.test import TestCase
import xlwt
# Create your tests here.
path_dst = r'I:\Work\Pycharm\Projects\virtualenv\day01\app01\res.xls'

def write_excel(data, sheetName, path):
    '''
    写入一些比对结果
    :param data:            [[xxx,xxx,xxx],[xxx,xxx,xxx]...]
    :param sheetName:       写入到哪张表中
    :param path:            写入的文件路径
    :return:                None
    '''
    wb_wt = xlwt.Workbook(encoding='utf-8')

    sheet = wb_wt.add_sheet(sheetName)

    for row_num, row_data in enumerate(data):
        for col_num, value in enumerate(row_data):
            sheet.write(row_num, col_num, value)

    wb_wt.save(path)

write_excel([[1, 2, 3], [4, 5]],'test1',path_dst, )
time.sleep(3)
write_excel([[1, 2, 3], [4, 5]],'test2',path_dst, )
write_excel([[1, 2, 3], [4, 5]],'test3',path_dst, )